import requests
# 获取请求头
def get_header():
    url_login = "http://127.0.0.1:8080/api/sys/login"  # 登录接口
    headers = {
        "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) "
                      "Chrome/105.0.0.0 Safari/537.36 Edg/105.0.1343.53"
    }
    data_log = {"mobile": "13800000002", "password": "123456"}
    reg = requests.post(url=url_login, headers=headers, json=data_log)
    token_en = "Bearer " + reg.json()['data']
    header = {"Content-Type": "application/json", "Authorization": token_en}
    return header